package com.neusoft.neuiotms.dcom.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.HandoverItemValueDTO;
import com.neusoft.neuiotms.dcom.model.HandoverItemValue;

@Component
public class HandoverItemValueConverter extends AbstractConverter<HandoverItemValue, HandoverItemValueDTO> {

    @Override
    public HandoverItemValue toModel(final HandoverItemValueDTO dto) {

        final HandoverItemValue model = new HandoverItemValue();
        model.setIsRequired(dto.getIsRequired());
        model.setName(dto.getName());
        model.setValue(dto.getValue());

        return model;
    }

    @Override
    public HandoverItemValueDTO toDTO(final HandoverItemValue model, final boolean forListView) {

        final HandoverItemValueDTO dto = new HandoverItemValueDTO();

        dto.setId(model.getId());
        dto.setIsRequired(model.getIsRequired());
        dto.setName(model.getName());
        dto.setValue(model.getValue());

        return dto;
    }

}
